<template>
	<view class="myCoupon">
		<view class="topList">
			<view @tap="data.num = index" :class="index == data.num?'active':''"
				v-for="(item,index) in data.topArr" :key="index">
				{{item.name}}
			</view>
		</view>
		<scroll-view scroll-y="true" >
			<view class="list">
				<view class="listItem" v-for="(item,index) in 10" :key="index">
					<view class="left">
						<text>免单购券</text>
						<view class="left_1">
							全场通用
						</view>
						<view class="right_1">
							有效期至：60年有效
						</view>
					</view>
					<view class="right">
						<text>30</text>
						<text>满 10000 元可用</text>
						<text>（订单金额）</text>
						<text>立即使用</text>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script setup lang="ts">

	import { reactive } from 'vue'
	const data = reactive({
		num: 2,
		topArr: [{ name: '全部' }, { name: '即将过期' }, { name: '平台券' }, { name: "店铺券" }]
	})
</script>

<style lang="scss">

	.myCoupon {
		height: 100vh;
		display: flex;
		position: relative;
		flex-direction: column;
		background-color: #F6F7F9;
		.list{
			>view:nth-of-type(1){
				margin-top: 0;
			}
		}
		.listItem{
			display: flex;
			margin-top: 24rpx;
			height: 248rpx;
			border-radius: 24rpx;
			overflow: hidden;
			background: #fff;
			>.left{
				flex: 1;
				position: relative;
				display: flex;
				flex-direction: column;
				justify-content: center;
				
				padding: 0 20rpx;
				>text{
					padding: 2rpx 12rpx;
					border-radius: 20rpx 0 20rpx 0;
					background: #FFD7AF;
					color: #C97210;
					font-size: 24rpx;
					position: absolute;
					left: 0;
					top: 0;
				}
				.left_1{
					font-size: 36rpx;
				}
				.right_1{
					font-size: 24rpx;
					margin-top: 60rpx;
				}
			}
			>.right{
				background: linear-gradient( 251deg, #FF3E61 0%, #FA2D1C 100%);
				box-shadow: -8rpx 0rpx 32rpx 0rpx rgba(255,57,43,0.2);
				width: 246rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				text:nth-of-type(1){
					font-size: 56rpx;
					color: #fff;
					&:before{
						content: '￥';
						font-size: 32rpx;
						color: #fff;
					}
				}
				text:nth-of-type(2){
					color: rgba(255,255,255,1);
					font-size: 22rpx;
					margin: 10rpx 0;
				}
				text:nth-of-type(3){
					color: rgba(255,255,255,1);
					font-size: 22rpx;
					margin-bottom: 10rpx;
				}
				text:nth-of-type(4){
					padding: 2rpx 16rpx;
					border-radius: 16rpx;
					background: #fff;
					color: #FA2D1C;
					font-size: 24rpx;
				}
			}
		}
		scroll-view {
			flex: 1;
			overflow: auto;
			padding: 32rpx 24rpx;
		}
		.topList{
			display: flex;
			justify-content: space-between;
			background-color: #fff;
			padding: 40rpx 60rpx 0 60rpx;
			view{
				display: flex;
				flex-direction: column;
				align-items: center;
				&::after{
					width: 40rpx;
					height: 4rpx;
					border-radius: 4rpx;
					margin-top: 10rpx;
					content: '';
					display: inline-block;
				}
			}
			.active{
				color: #6B64D3;
				&::after{
					background-color: #6B64D3;
				}
			}
		}
	}


	
</style>